
$(function ()
{
	$(".shang li").click(function(){
		var indexA = $(this).index();
		$(this).addClass("greenBg");
		$(this).siblings().removeClass("greenBg");
		$(this).parents(".content").find(".xia").hide();
		$(this).parents(".content").find(".xia").eq(indexA).show();
		return false;
		
	})

    $.ajax({
        type: "Get",
        url: "GetCertificateList",
        data: null,
        success: function (response) {
            var certificateList = response.CertificateList;
            var html = [];
            html.push("<div id='focus_Box'>");
            html.push("<span class='prev'>&nbsp;</span><span class='next'>&nbsp;</span>");
            html.push("<ul>");
            for (var i = 0; i < certificateList.length; i++) {
                var certificate = certificateList[i];
                html.push("<li style='display: none; width: 0px; height: 0px; top: 37px; left: 255px; z-index: 2;'><img src='/Public/Images/zhengshu/" + certificate.ImageUrl + "' style='opacity: 1;' alt='" + certificate.Name + "' width='218' height='295' /></li>");
            }
            html.push("</ul>");
            html.push("</div>");

            $(".fourLt").html(html.join(""));
        }
    });
	

    $(".pianAn li").click(function () {
        var pianAnli = $(this);
        var indexA = pianAnli.index();
        pianAnli.addClass("greenBg");
        pianAnli.siblings().removeClass("greenBg");
        pianAnli.parents(".five").find(".anXia").hide();
        pianAnli.parents(".five").find(".anXia").eq(indexA).show();

        if (pianAnli.attr("tag") == 1) {
            $.ajax({
                type: "Get",
                url: "GetWeChatClientList",
                data: null,
                success: function (response) {
                    var clientList = response.ClientList;
                    var html = [];
                    html.push("<div class='section'>");
                    html.push("<div class='tempWrap' style='overflow:hidden; position:relative; width:900px'>");
                    html.push("<ul class='clearfix' style='width: 6750px; position: relative; overflow: hidden; padding: 0px; margin: 0px; left: -2250px;'>");
                    for (var i = 0; i < clientList.length; i++) {
                        var client = clientList[i];
                        html.push("<li style='float: left; width: 212px;'><div class='photo'><img src='/Public/Images/WeChat/" + client.WeChatImageUrl + "' /></div><div class='rsp' style='display: none;'></div><div class='text'><p class='weiXin clr'><img width='159' src='/Public/Images/WeChat/" + client.QRImageUrl + "' /></p><p class='chakanX clr'><a href=''>" + client.ClientName + "</a></p></div></li>");
                    }
                    html.push("</ul>");
                    html.push("</div><div class='clear'></div></div>");

                    $(".mr_frUl").html(html.join(""));

                    $(".section ul li .rsp").hide();
                    $(".section     ul li").hover(function () {
                        $(this).find(".rsp").stop().fadeTo(500, 0.7)
                        $(this).find(".text").stop().animate({ left: '0' }, { duration: 500 })
                    },
                    function () {
                        $(this).find(".rsp").stop().fadeTo(500, 0)
                        $(this).find(".text").stop().animate({ left: '300' }, { duration: "fast" })
                        $(this).find(".text").animate({ left: '-300' }, { duration: 0 })
                    });

                    $(".mr_frUl ul li img").hover(function () { $(this).css("border-color", "#A0C0EB"); }, function () { $(this).css("border-color", "#d8d8d8") });
                    jQuery(".mr_frbox").slide({ titCell: "", mainCell: ".mr_frUl ul", autoPage: true, effect: "leftLoop", autoPlay: true, vis: 4 });

                },
                dataType: "json"
            });
        }
        return false;
    })
	
	
	
})
        
function banner(){    
	var bn_id = 0;
	var bn_id2= 1;
	var speed33=4000;
	var qhjg = 1;
	var MyMar33;
	$("#banner .d1").hide();
	$("#banner .d1").eq(0).fadeIn("slow");
	if($("#banner .d1").length>1)
	{
		$("#banner_id li").eq(0).addClass("nuw");
		function Marquee33(){
			bn_id2 = bn_id+1;
			if(bn_id2>$("#banner .d1").length-1)
			{
				bn_id2 = 0;
			}
			$("#banner .d1").eq(bn_id).css("z-index","2");
			$("#banner .d1").eq(bn_id2).css("z-index","1");
			$("#banner .d1").eq(bn_id2).show();
			$("#banner .d1").eq(bn_id).fadeOut("slow");
			$("#banner_id li").removeClass("nuw");
			$("#banner_id li").eq(bn_id2).addClass("nuw");
			bn_id=bn_id2;
		};
	
		MyMar33=setInterval(Marquee33,speed33);
		
		$("#banner_id li").click(function(){
			var bn_id3 = $("#banner_id li").index(this);
			if(bn_id3!=bn_id&&qhjg==1)
			{
				qhjg = 0;
				$("#banner .d1").eq(bn_id).css("z-index","2");
				$("#banner .d1").eq(bn_id3).css("z-index","1");
				$("#banner .d1").eq(bn_id3).show();
				$("#banner .d1").eq(bn_id).fadeOut("slow",function(){qhjg = 1;});
				$("#banner_id li").removeClass("nuw");
				$("#banner_id li").eq(bn_id3).addClass("nuw");
				bn_id=bn_id3;
			}
		})
		$("#banner_id").hover(
			function(){
				clearInterval(MyMar33);
			}
			,
			function(){
				MyMar33=setInterval(Marquee33,speed33);
			}
		)    
	}
	else
	{
		$("#banner_id").hide();
	}
}
        
        
        
        
        
        